/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package q2;

import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author c0909h1155
 */
public class Data {
    String[] data ={
        "Ha Noi",
        "Hai Phong",
        "Da Nang",
    };

    boolean flag = false;

    int random;

    public Data(){

    }

    public void getRandom() {

        
        Random randomObj = new Random();
        int rn = randomObj.nextInt(5);
        System.out.println(rn);

        try {
            
            Thread.sleep(500);
            
        } catch (InterruptedException ex) {
            Logger.getLogger(Data.class.getName()).log(Level.SEVERE, null, ex);
        }

        this.random = rn;
    }

    public void displayName() {

        System.out.println(this.data);

        
        try {
            Thread.sleep(500);
        } catch (InterruptedException ex) {
            Logger.getLogger(Data.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
